<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Jobs\DcsDataReportJob;

/**
 * 上报本地DCS数据到总部
 */
class DcsDataReportCmd extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'dcsdata:report';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Report dcsdata';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $params = array(
            'local_conn' => 'sqlsrv—local',
            'remote_conn' => 'sqlsrv',
            'local_data_table' => "dcs_yongqiang1",
            'remote_data_table' => "dcs_yongqiang1"
        );
        dispatch(new DcsDataReportJob($params));
        return 0;
    }
}
